<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Mailing List Manager<%= " - #{@title}" unless @title.blank? %></title>
	
	<%= stylesheet_link_tag 'application', params[:controller] %>
	
	<%= javascript_include_tag :defaults, 'behaviour' %>
	<%= javascript_include_tag params[:controller] %><% # Make sure the controller js is loaded after application.js %>
	
	<script type="text/javascript" charset="utf-8">
	function toggleItem(el) {		
		if (Element.hasClassName(el.parentNode, "open")) {
			Element.removeClassName(el.parentNode, "open");
		} else {
			Element.addClassName(el.parentNode, "open");
		}
		
		return false;
	}
	</script>
	<%= @header %>
</head>
<body>
	<table id="logos">
		<tr>
			<th class="left"><%= image_tag "ardent.gif", :size => "85x35" %></th>
			<th><h1>Mailing List Manager</h1></th>
			<th class="right"><%= image_tag "areasq.gif" %></th>
		</tr>
	</table>
	<div id="userinfo">
		<p>Logged in as Jon | Logout</p>
	</div>
	<table id="container">
		<tr>
			<td width="20%" id="menu_cell">
				<!-- TODO: Preserve menu state over requests -->
				<ul id="menu">
					<li class="item">
						<h6>Dashboard</h6>
					</li>
					<li>
						<h6>E-Shots</h6>
						<ul>
							<li>Create E-Shot</li>
							<li>Drafts</li>
							<li>Sent E-Shots</li>
						</ul>
					</li>
					<li>
						<h6>Contacts</h6>
						<ul>
							<li><%= link_to "View Contacts", :controller => "contacts" %></li>
							<li><%= link_to "Add Contact", :controller => "contacts", :action => "create" %></li>
							<li>View Groups</li>
							<li>Add Group</li>
						</ul>
					</li>
					<li>
						<h6>Users</h6>
						<ul>
							<li>View Users</li>
							<li>Add User</li>
						</ul>
					</li>
					<li>
						<h6>Ardent</h6>
						<ul>
							<li>View Clients</li>
							<li>Add Client</li>
							<li>View Templates</li>
							<li>Add Template</li>
							<li>Mail Queue</li>
						</ul>
					</li>
				</ul>
				<div id="support">
					<a href="mailto:support@ardentcreative.co.uk?subject=Mailing List Manager">support@ardentcreative.co.uk</a>
				</div>
			</td>
			<td id="content" width="80%">
				<h2><%= @title %></h2>
				<% unless flash[:info].blank? %>
					<div id="flash" class="<%= flash[:info][:type] || 'info' %>">
						<h3><%= flash[:info][:title] %></h3>
						<p><%= flash[:info][:explanation] %></p>
					</div>
				<% end %>
				<%= yield %>
			</td>
		</tr>
	</table>
	<div id="footer">
		<p>Copyright &copy; 2006, Ardent Creative</p>
	</div>
</body>
</html>
